import request from '/@/utils/request';

export function workflowApi() {
	return {
		getRoles: (data: object) => {
			return request({
				url: '/role/getRoleList',
				method: 'post',
				data,
			});
		},
		getDepartments: (data: object) => {
			return request({
				url: '/department/getDepartmentList',
				method: 'post',
				data,
			});
		},
		getEmployees: (data: object) => {
			return request({
				url: '/user/getEmployeeList',
				method: 'post',
				data,
			});
		},
		getConditions: (data: object) => {
			return request({
				url: '/static/conditions.json',
				method: 'get',
				data,
			});
		},
		saveWorkFlowData: (data: object) => {
			return request({
				url: '/workflow/add',
				method: 'post',
				data,
			});
		},
		validateExpression: (data: object) => {
			return request({
				url: '/workflow/expression/validate',
				method: 'post',
				data,
			});
		},
	};
}
